package com.irdstudio.efp.limit.service.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.irdstudio.basic.framework.core.base.DataOptionalAuthorityDao;
import com.irdstudio.efp.limit.service.domain.LmtFreezeApp;
import com.irdstudio.efp.limit.service.vo.LmtFreezeAppVO;
/**
 * <p>DAO interface:额度冻结申请表				<p>
 * @author fuzm
 * @date 2018-06-05
 */
public interface LmtFreezeAppDao extends DataOptionalAuthorityDao {
	
	public int insertLmtFreezeApp(LmtFreezeApp lmtFreezeApp);
	
	public int deleteByPk(LmtFreezeApp lmtFreezeApp);
	
	public int updateByPk(LmtFreezeApp lmtFreezeApp);
	/**
	 * 更新审批状态
	 * @param lmtFreezeApp
	 * @return
	 */
	public int updateApproveStatusByPk(LmtFreezeApp lmtFreezeApp);
	
	public LmtFreezeApp queryByPk(LmtFreezeApp lmtFreezeApp);
	
	public List<LmtFreezeApp> queryAllOwnerByPage(LmtFreezeAppVO lmtFreezeApp);
	
	public List<LmtFreezeApp> queryAllCurrOrgByPage(LmtFreezeAppVO lmtFreezeApp);
	
	public List<LmtFreezeApp> queryAllCurrDownOrgByPage(LmtFreezeAppVO lmtFreezeApp);
	/**
	 * 查询授信协议编号下的冻结记录
	 * @param lmtFreezeApp
	 * @return
	 */
	public List<LmtFreezeApp> queryLmtFresByLmtContNoByPage(LmtFreezeAppVO lmtFreezeApp);
	/**
	 * 根据授信协议编号,审批状态查询额度冻结申请总数
	 * @param lmtFreezeApp
	 * @return
	 */
	public int queryAppStatusCountByLmtContNo(LmtFreezeAppVO lmtFreezeApp);
	
	/**
	 * 根据对象查寻冻结记录，返回根据创建日期进行排序
	 * @param lmtFreezeApp
	 * @return
	 */
	public List<LmtFreezeApp> queryListAndOrderByCreateTime(LmtFreezeAppVO lmtFreezeApp);
	
	/**
	 * 检查是否存在审批中的冻结申请
	 * @param lmtContNo
	 * @return
	 */
	public int queryIfExistsFreezeProcessing(@Param("lmtContNo") String lmtContNo);
}
